package com.neuedu.controller;

import com.neuedu.domain.User;
import com.neuedu.result.Result;
import com.neuedu.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/{id}")
    public Result<User> queryById(@PathVariable Integer id) {
        User user = userService.queryById(id);
        return Result.success(user);
    }
}
